package com.toy.controller;

import com.toy.entity.User;
import com.toy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/toy")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/user")
    @ResponseBody
    public User ListUser() {
        return  userService.listUser();
    }

    @RequestMapping("/test")
    @ResponseBody
    public String test(){
        return  "test";
    }
}
